package itqf.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * com.itqf.utils
 * 2020/9/17
 */
public class OrdersUtils {
    public static String createOrderId(){
        String oid = "";
        for (int i = 0; i < 8; i++) {
            oid+=(char)(65 + new Random().nextInt(26));
        }
        oid+=System.currentTimeMillis();
        return oid;
    }

    public static Date DateFormat(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date();
        String format = sdf.format(date);
        try {
            Date newdate = sdf.parse(format);
            return newdate;
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }
}
